#ifndef _PROBE_
#define _PROBE_

#include <iostream>

#include "aerial\FlyObject.h"

#include "hge\hge.h"
#include "hge\hgesprite.h"
#include "hge\hgevector.h"
#include "hge\hgeresource.h"

using namespace air;
using namespace std;

/**
 * @brief a type of aircraft
 */
class Probe: public FlyObject
{
public:
	/**
	 * @brief constructor
	 *
	 * @param hgeResMan pointer to hgeResourceManager
	 * @param x 	horizontal position
	 * @param y 	vertical position
	 */
	Probe(hgeResourceManager* hgeResMan, HGE* hge, NetIO* netIO, float x, float y);
	~Probe();

	void render();
	bool update(float dt);
	void processPacket(Packet* p) {}
	/**
	 * @rotate probe by a certain degree clock wise
	 *
	 * @param angle = dt * rad;
	 */
	void clockwiseRotate(float dt);
	/**
	 * @rotate probe by a certain degree counter clock wise
	 *
	 * @param angle = dt * rad;
	 */
	void cclockwiseRotate(float dt);

	void fly(float dt) {
		x += vx * 200 * dt;
		y += vy * 200 * dt;
	}

	/**
	 * @brief set shield status for probe. 0: closed 1: closing 2: expanding 3: expanded
	 */
	void setShieldStatus(bool _status) 
	{
		if (_status)
		{
			if (shieldStatus < 2) shieldStatus = 2;
		} else
		{
			if (shieldStatus > 1) shieldStatus = 1;
		}
	}
	float x, y;
	float rot;
private:

	int lp, energy;

	hgeSprite* spr;
	hgeSprite* shield;
	hgeSprite* shieldHalo;

	int shieldStatus;
	float shield_radius;
	float halo_radius;

	DWORD R, G, B;
	float vx, vy;
	//float shield_time;
};


#endif
